function myInstanceof(instance, target) {
  // 定义一个指针指向实例
  let pointer = instance;
  while (pointer) {
    //   一个实例的隐式原型 等于构造函数的显示原型
    if (pointer == target.prototype) {
      return true;
    } else {
      pointer = pointer.__proto__;
    }
  }
  return false;
}

let obj = {};
let res = myInstanceof(obj, Object);
console.log(res); // true
